package com.gp.controller;

import com.gp.entity.TbCarType;
import com.gp.entity.TbShop;
import com.gp.service.CarShopService;
import com.gp.util.CommonResult;
import com.gp.vo.CarShopVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@CrossOrigin
@RequestMapping("rent/carShop")
public class CarShopController {

    @Autowired(required = false)
    private CarShopService carShopService;



    @PostMapping("findAllShop")
    public CommonResult openpage(Integer page,Integer limit,@RequestBody CarShopVo carShopVo){
        return carShopService.openshoppage(page,limit,carShopVo);
    }


    @DeleteMapping("delCarById")
    private CommonResult delCarById(Integer id){
        return carShopService.delCarById(id);
    }

    @GetMapping("allAddre")
    private CommonResult FindAllAddress(Integer id){
        return carShopService.findFirstAdress(id);
    }


    @PostMapping("insert")
    private CommonResult insert(@RequestBody TbShop tbShop){
        return carShopService.insert(tbShop);
    }

    @PutMapping("update")
    private CommonResult updateCartype(@RequestBody TbShop tbShop){
        return carShopService.update(tbShop);
    }

}
